#include <bits/stdc++.h>
using namespace std;

int main() {
    int nGroup;
    cin >> nGroup;
    while (nGroup-- > 0) {
        double a, b, c;
        cin >> a >> b >> c;
        double delta = 4 * (a * a - 2 * a * b * c);
        if (delta < 0) {
            printf("%.10lf\n", 0); continue;
        }
        double y1 = (a - sqrt(delta / 4)) / b;
        double y2 = (a + sqrt(delta / 4)) / b;
        double r1 = -pow(y1, 3) / (6 * a) + pow(y1, 2) / (2 * b) - y1 * c / b;
        double r2 = -pow(y2, 3) / (6 * a) + pow(y2, 2) / (2 * b) - y2 * c / b; 
        printf("%.10lf\n", r2 - r1);
    }
    return 0;
}

// 作者：sxfzzz
// 链接：https://www.nowcoder.com/exam/test/86901681/submission?pid=30545524
// 来源：牛客网